
# 过滤列表中空字符串
list1 = ["", "1","", "1","", "1", None]
_list1 = [x for x in list1 if  x != "" and x is not None]
print("过滤列表中空字符串：", _list1)

# 过滤列表中的空字符以及\\n\\t
list2 = ["\n\t\t\t\t\t\t\t\t\t", "\n\t\t\t\t\t\t\t\t\t闵行-华漕 | 2室1厅1卫 | 朝西北\t\t\t\t\t\t\t\t", "\n\t\t\t\t\t\t\t\t\t"]
_list2 = [x.strip() for x in list2 if x.strip()!='']
print("过滤列表中的空字符以及\\n\\t：", _list2)

